package kr.hkit.powerjava.chapter14.work;

import java.awt.Container;
import java.awt.Dimension;
import java.awt.Panel;
import java.awt.Toolkit;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;

public class MainTab extends JFrame {
	private Container container;
	private JTabbedPane mTab;
	private MilePanel mPanel;
	private ExPanel ePanel;
	Toolkit kit = Toolkit.getDefaultToolkit();
	Dimension screenSize = kit.getScreenSize();
	
	public MainTab(){
		setTitle("ch 14. Programming");
		setSize(300,300);
		setLocation(screenSize.width/2, screenSize.height/2);
		setDefaultCloseOperation(MainTab.EXIT_ON_CLOSE);
		
		mPanel = new MilePanel();
		ePanel = new ExPanel();
		
		container = getContentPane();
		mTab = new JTabbedPane();
		mTab.addTab("마일계산기", mPanel);
		mTab.addTab("환율계산기", ePanel);
	
		getContentPane().add(mTab);
		setVisible(true);
	}
	
	public static void main(String[] args) {
		MainTab tab1 = new MainTab();
	}
}